<template>
  <div class="app-container">
    <el-card style="margin-top: 30px;">
      <el-descriptions
        title="当前入库任务"
        size="medium"
        :content-style="{ 'font-size': '40px' }"
        :label-style="{ 'font-size': '40px' }"
      >
        <el-descriptions-item label="任务编码">{{ errInfo.missionCode }}</el-descriptions-item>
        <el-descriptions-item label="载盘编码">{{ errInfo.palletCode }}</el-descriptions-item>
        <el-descriptions-item label="起点">{{ errInfo.source }}</el-descriptions-item>
        <el-descriptions-item label="终点">{{ errInfo.destination }}</el-descriptions-item>
        <el-descriptions-item label="创建时间">{{ errInfo.createTime }}</el-descriptions-item>

      </el-descriptions>
      <div class="rightbutton">
        <el-button type="danger" :disabled="!errInfo.missionCode" @click="openNewPage">异常恢复</el-button>
      </div>
    </el-card>
  </div>
</template>
<script>
import { getError, del } from '@/api/error'
export default {
  data() {
    return {
      errInfo: {}
    }
  },

  mounted() {
    this.getError()
  },
  methods: {
    getError() {
      getError().then(res => {
        if (res.meta.code === 200) {
          this.errInfo = res.data.inboundMission
        } else {
          this.errInfo = {}
        }
      })
    },
    openNewPage() {
      this.$confirm(`请确认W15识别到的载盘码与(${this.errInfo.palletCode})是否不同`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        del(this.errInfo.missionCode).then(res => {
          if (res.meta.code === 200) {
            this.getError()
            this.$message({
              type: 'success',
              message: '操作成功!'
            })
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消'
        })
      })
    }
  }
}
</script>
  <style rel="stylesheet/scss" lang="scss" scoped>
  ::v-deep .el-descriptions--medium:not(.is-bordered) .el-descriptions-item__cell {
    padding-bottom: 36px;
  }

  ::v-deep .custom-message {
    font-size: 180px;
    /* 修改为你想要的字体大小 */
  }

  ::v-deep .el-descriptions__title {
    font-size: 36px;
  }

  .rightbutton {
    width: 100%;
    text-align: center;
    margin-top: 50px;
    .el-button {
      width: 600px;
      height: 250px;
      font-size: 80px;
      font-weight: bold;
      border-radius: 30px;
    }
  }
  ::v-deep .el-message-box {
    .el-message-box__status+.el-message-box__message {
      font-size: 30px;
    }
  }
  </style>
